Sugar pill fixes for alleged x86-64 compiler bug.
authorrobertl <robertl>
Wed, 17 Jun 2009 01:27:34 +0000 (01:27 +0000)
committerrobertl <robertl>
Wed, 17 Jun 2009 01:27:34 +0000 (01:27 +0000)
itracku.c
wbt-200.c

index 493dfeab4a29857c73e1609d453c15b763d0ed2a..d23d91696b22f8eb79b5c54cffe8ff2c0d919e8a 100644 (file)
--- a/itracku.c
+++ b/itracku.c
@@ -392,7 +392,7 @@ itracku_rd_ser_init(const char *fname)
                                break;
                        }
                        dbg(1, "trying port %s", port);
-                       if (fd = gbser_init(port), NULL == fd) {
+                       if ((fd = gbser_init(port)) == NULL) {
                                dbg(1, "port %s not available.", port);
                                continue;
                        }
@@ -413,7 +413,7 @@ itracku_rd_ser_init(const char *fname)
                                break;
                        }
                        dbg(1, "trying port %s", port);
-                       if (fd = gbser_init(port), NULL == fd) {
+                       if ((fd = gbser_init(port)) == NULL) {
                                dbg(1, "port %s not available.", port);
                                continue;
                        }
@@ -440,7 +440,7 @@ itracku_rd_ser_init(const char *fname)
                        port = xstrdup(fname);
 
                        dbg(1, "opening port %s", fname);
-                       if (fd = gbser_init(port), NULL == fd)
+                       if ((fd = gbser_init(port)) == NULL)
                        {
                                fatal(MYNAME ": can't initialise port \"%s\"", port);
                        }
index a4cfc8381cd66d1ae5e756744c3fc9bd75572e5e..ab1e0d94b710ad95516799b838f4b624883aeb49 100644 (file)
--- a/wbt-200.c
+++ b/wbt-200.c
@@ -197,10 +197,8 @@ static size_t buf_read(struct buf_head *h, void *data, size_t len) {
 static void buf_extend(struct buf_head *h, size_t amt) {
     struct buf_chunk *c;
     size_t sz = amt + sizeof(struct buf_chunk);
-    if (c = xmalloc(sz), NULL == c) {
-        fatal(MYNAME ": Can't allocate %lu bytes for buffer\n", (unsigned long) sz);
-    }
 
+    c = xmalloc(sz);
     c->next = NULL;
     c->size = amt;
     c->used = 0;
@@ -374,7 +372,7 @@ static void rd_init(const char *fname) {
     port = xstrdup(fname);
 
     db(1, "Opening port...\n");
-    if (fd = gbser_init(port), NULL == fd) {
+    if ((fd = gbser_init(port)) == NULL) {
         fatal(MYNAME ": Can't initialise port \"%s\"\n", port);
     }
     
@@ -404,7 +402,7 @@ static int rd_buf(void *buf, int len) {
 
 static void file_init(const char *fname) {
     db(1, "Opening file...\n");
-    if (fl = fopen(fname, "rb"), NULL == fl) {
+    if ((fl = fopen(fname, "rb")) == NULL) {
         fatal(MYNAME ": Can't open file '%s'\n", fname);
     }
 }